// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
//用户列表
import userList from '@/views/user/userList'
//添加用户
import addUser from '@/views/user/addUser'
//政策法规列表
import policyList from '@/views/policy/policyList'
//新增政策法规
import addPolicy from '@/views/policy/addPolicy'
//国防知识列表
import NDadd from '@/views/national-defense/NDadd'
//添加国防知识
import NDList from '@/views/national-defense/NDList'
//通知公告列表
import addAffiche from '@/views/affiche/addAffiche'
//新增通知公告
import afficheList from '@/views/affiche/afficheList'
//退役管理
import retirement from '@/views/retirement/retirement'
//后勤保障
import logistics from '@/views/logistics/logistics'
// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/user/userList',
            name: '用户列表',
            component: userList,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/user/addUser',
            name: '添加用户',
            component: addUser,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/policy/policyList',
            name: '政策法规列表',
            component: policyList,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/policy/addPolicy',
            name: '新增政策法规',
            component: addPolicy,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/national-defense/NDList',
            name: '国防知识列表',
            component: NDList,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/national-defense/NDadd',
            name: '添加国防知识',
            component: NDadd,
            meta: {
                requireAuth: true
            }
        },{
            path: '/affiche/afficheList',
            name: '通知公告列表',
            component: afficheList,
            meta: {
                requireAuth: true
            }
        },  {
            path: '/affiche/addAffiche',
            name: '添加通知公告',
            component: addAffiche,
            meta: {
                requireAuth: true
            }
        },{
            path: '/retirement/retirement',
            name: '退役管理',
            component: retirement,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/logistics/logistics',
            name: '后勤保障',
            component: logistics,
            meta: {
                requireAuth: true
            }
        }]
    }]
})